Configurable array of single-photon detectors

ABSTRACT

Optical sensing apparatus includes at least one semiconductor substrate and a first array of single-photon detectors, which are disposed on the at least one semiconductor substrate, and second array of counters, which are disposed on the at least one semiconductor substrate and are configured to count electrical pulses output by the single-photon detectors. Routing and aggregation logic is configured, in response to a control signal, to connect the single-photon detectors to the counters in a first mode in which each of at least some of the counters aggregates and counts the electrical pulses output by a respective first group of one or more of the single-photon detectors, and in a second mode in which each of the at least some of the counters aggregates and counts the electrical pulses output by a respective second group of two or more of the single-photon detectors.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the benefit of U.S. Provisional Patent Application 62/942,761, filed Dec. 3, 2019, which is incorporated herein by reference.

FIELD OF THE INVENTION

The present invention relates generally to systems and methods for depth mapping, and particularly to sensor arrays used in time-of-flight sensing.

BACKGROUND

Time-of-flight (TOF) imaging techniques are used in many depth mapping systems (also referred to as 3D mapping or 3D imaging). In direct TOF techniques, a light source, such as a pulsed laser, directs pulses of optical radiation toward the scene that is to be mapped, and a high-speed detector senses the time of arrival of the radiation reflected from the scene. The depth value at each pixel in the depth map is derived from the difference between the emission time of the outgoing pulse and the arrival time of the reflected radiation from the corresponding point in the scene, which is referred to as the “time of flight” of the optical pulses.

Single-photon avalanche diodes (SPADs), also known as Geiger-mode avalanche photodiodes (GAPDs), are detectors capable of capturing individual photons with very high time-of-arrival resolution, of the order of a few tens of picoseconds. They may be fabricated in dedicated semiconductor processes or in standard CMOS technologies. Arrays of SPAD sensors, fabricated on a single chip, have been used experimentally in 3D imaging cameras.

U.S. Patent Application Publication 2017/0052065, whose disclosure is incorporated herein by reference, describes a sensing device that includes a first array of sensing elements, which output a signal indicative of a time of incidence of a single photon on the sensing element. A second array of processing circuits are coupled respectively to the sensing elements and comprise a gating generator, which variably sets a start time of the gating interval for each sensing element within each acquisition period, and a memory, which records the time of incidence of the single photon on each sensing element in each acquisition period. A controller controls the gating generator during a first sequence of the acquisition periods so as to sweep the gating interval over the acquisition periods and to identify a respective detection window for the sensing element, and during a second sequence of the acquisition periods, to fix the gating interval for each sensing element to coincide with the respective detection window.

SUMMARY

Embodiments of the present invention that are described hereinbelow provide improved apparatus and methods for optical sensing.

There is therefore provided, in accordance with an embodiment of the invention, optical sensing apparatus, including at least one semiconductor substrate and a first array of single-photon detectors, which are disposed on the at least one semiconductor substrate and are configured to output electrical pulses in response to photons that are incident thereon. A second array of counters are disposed on the at least one semiconductor substrate and are configured to count the electrical pulses output by the single-photon detectors. Routing and aggregation logic is configured, in response to a control signal, to connect the single-photon detectors to the counters in a first mode in which each of at least some of the counters aggregates and counts the electrical pulses output by a respective first group of one or more of the single-photon detectors, and in a second mode in which each of the at least some of the counters aggregates and counts the electrical pulses output by a respective second group of two or more of the single-photon detectors.

In a disclosed embodiment, the single-photon detectors includes single-photon avalanche diodes (SPADs).

In some embodiments, the control signal includes a gating signal, and the counters are configured to aggregate and count the electrical pulses over respective periods indicated by the gating signal. Typically, the gating signal causes different ones of the counters to aggregate and count the electrical pulses over different, respective gating intervals, so that the second array of counters outputs a histogram of the electrical pulses output by the single-photon detectors with bins defined responsively to the gating intervals. In disclosed embodiments, the apparatus includes a radiation source, which is configured to direct a series of optical pulses toward a target scene, and the single-photon detectors are configured to receive optical radiation that is reflected from the target scene, and the counters are configured to aggregate and count the electrical pulses while the gating intervals are synchronized with the optical pulses with a delay between the optical pulses and the gating intervals that is swept over a sequence of different delay times during the series of the optical pulses. In one embodiment, the counters are configured to aggregate and count the electrical pulses in first and second bins of the histogram while the gating intervals are swept over the sequence of different delay times, and the apparatus includes a processor, which is configured to compute a time of flight of the optical pulses by comparing respective first and second counts accumulated in the first and second bins.

Additionally or alternatively, in the first mode, each of the counters counts the electrical pulses that are output by a single, respective one of single-photon detectors. In some embodiments, in the second mode, each of the at least some of the counters aggregates and counts the electrical pulses output by at least four of the single-photon detectors that are mutually adjacent in the first array. In disclosed embodiments, the control signal includes a gating signal, which causes the counters to aggregate and count the electrical pulses over respective gating intervals, and the apparatus includes a radiation source, which is configured to direct a series of optical pulses toward a target scene, wherein the single-photon detectors are configured to receive optical radiation that is reflected from the target scene, and a processor, which is configured to compute a time of flight of the optical pulses responsively to counts of the electrical pulses that are output by the counters over different gating intervals while operating in the second mode, and to apply the computed time of flight in setting a gating interval for the counters in the first mode. In one embodiment, the processor is configured to generate a three-dimensional (3D) map of the target scene responsively to the time of flight computed in the second mode, to identify an object of interest in the 3D map, and to set the gating interval for the counters in the first mode responsively to a depth of the object of interest in the 3D map so as to acquire a two-dimensional (2D) image of the object of interest.

There is also provided, in accordance with an embodiment of the invention, a method for optical sensing, which includes providing, on at least one semiconductor substrate, a first array of single-photon detectors, which are configured to output electrical pulses in response to photons that are incident on the single-photon detectors, and a second array of counters, which are configured to count the electrical pulses output by the single-photon detectors. In response to a control signal, the single-photon detectors are connected to the counters in a first mode in which each of at least some of the counters aggregates and counts the electrical pulses output by a respective first group of one or more of the single-photon detectors, and in a second mode in which each of the at least some of the counters aggregates and counts the electrical pulses output by a respective second group of two or more of the single-photon detectors.

There is additionally provided, in accordance with an embodiment of the invention, a method for optical sensing, which includes directing a series of optical pulses toward a target scene and imaging optical radiation that is reflected from the target scene onto an array of single-photon detectors, which output electrical pulses in response to photons that are incident thereon. The electrical pulses output by the single photon detectors are counted in multiple different gating intervals that are synchronized with each of the optical pulses, including at least first and second gating intervals at different, respective delays relative to the optical pulses, while the delays are swept over a sequence of different delay times during the series of the optical pulses. A time of flight of the optical pulses is computed by comparing respective first and second counts of the electrical pulses that were accumulated in the first and second gating intervals over the series of the optical pulses.

In some embodiments, counting the electrical pulses includes aggregating the pulses over groups of mutually-adjacent single-photon detectors in the array.

Additionally or alternatively, the first and second gating intervals are synchronized at respective first and second delays relative to the optical pulses, such that a difference between the first and second delays remains fixed while the first and second delays are swept over the sequence of different delay times during the series of the optical pulses. In one embodiment, the second gating interval begins upon termination of the first gating interval. Alternatively, an initial part of the second gating interval overlaps with the first gating interval. Additionally or alternatively, the first and second gating intervals have a common, predefined duration, and the sequence of the different delay times spans the predefined duration.

In a disclosed embodiment, the gating intervals are selected responsively to a range of the target scene so that the photons in the series of the optical pulses that are reflected from the target scene are incident on the array of single-photon detectors only during the first and second gating intervals.

In some embodiments, the multiple different gating intervals include at least a third gating interval, such that the electrical pulses counted during the third gating interval are indicative of a background component of the optical radiation that is incident on the array of single-photon detectors, and computing the time of flight includes compensating for the background component in comparing the first and second counts. In one embodiment, the third gating interval is synchronized with the optical pulses so as to measure stray photons in the optical pulses that are incident on the array of single-photon detectors without having reflected from the target scene. Alternatively or additionally, the electrical pulses counted during the third gating interval are indicative of an ambient component of the optical radiation that is incident on the array of single-photon detectors. In a disclosed embodiment, computing the time of flight includes calculating a ratio of the first and second counts after subtraction of the background component counted during at least the third gating interval.

There is further provided, in accordance with an embodiment of the invention, apparatus for optical sensing, including a radiation source, which is configured to direct a series of optical pulses toward a target scene, and a first array of single-photon detectors, which are configured to receive optical radiation that is reflected from the target scene and to output electrical pulses in response to photons that are incident thereon. A second array of counters are configured to count the electrical pulses output by the single photon detectors in multiple different gating intervals that are synchronized with each of the optical pulses, including at least first and second gating intervals at different, respective delays relative to the optical pulses, while the delays are swept over a sequence of different delay times during the series of the optical pulses. A processor is configured to compute a time of flight of the optical pulses by comparing respective first and second counts of the electrical pulses that were accumulated in the first and second gating intervals over the series of the optical pulses.

The present invention will be more fully understood from the following detailed description of the embodiments thereof, taken together with the drawings in which:

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic side view of depth mapping apparatus, in accordance with an embodiment of the invention;

FIG. 2 is a block diagram showing detectors and processing circuits making up a super-pixel in a sensing array, in accordance with an embodiment of the invention;

FIG. 3 is a block diagram showing details of routing and aggregation logic in a sensing array, in accordance with an embodiment of the invention;

FIG. 4 is a block diagram that schematically illustrates an operating configuration of a super-pixel in an aggregation mode, in accordance with an embodiment of the invention; and

FIGS. 5-7 are timing diagram that schematically illustrates methods for measuring TOF to a target scene, in accordance with embodiments of the invention.

DETAILED DESCRIPTION OF EMBODIMENTS Overview

The speed and sensitivity of single-photon detectors, such as SPADs, makes them a good choice for TOF imaging. SPAD arrays with integrated control logic and memory, such as those described above in the Background section, are starting to become commercially available. These integrated array devices, however, are still limited by the tradeoff of array pitch and power consumption against the spatial and depth resolution that they are capable of achieving.

Embodiments of the present invention that are described herein provide optical sensing apparatus and methods that address this tradeoff, and achieve more versatile SPAD array operation and more accurate depth mapping for a given array size and pitch.

Some embodiments provide optical sensing apparatus in which an array of single-photon detectors, such as SPADs, are disposed on a semiconductor substrate and output electrical pulses in response to incident photons. An array of counters, also disposed on the semiconductor substrate, count the electrical pulses output by the single-photon detectors. Routing and aggregation logic on the substrate is able to vary the configuration of the counters, relative to the detectors, in response to external control signals, and specifically to connect different groups of the single-photon detectors to different counters.

For example, in a first mode, each of the counters (or at least each of at least some of the counters) aggregates and counts the electrical pulses output by a respective first group of the single-photon detectors, which may even include only a single detector—meaning that each counter is connected to its own detector. In this mode it is also possible to create a two-dimensional (2D) image of a scene, in which the pixel values are given by the number of counts accumulated from each detector.

In a second mode, on the other hand, each of these counters aggregates and counts the electrical pulses output by a respective second group, which includes two or more of the detectors. Each counter can be gated to count the pulses it receives during a respective gating interval. In this manner, two or more counters with different gating intervals can be used together to construct a histogram of photon arrival times over the corresponding group of detectors. The gating intervals can be synchronized with optical pulses emitted by a radiation source in order to measure the times of flight of photons reflected from a target scene, and thus create a three-dimensional (3D) map of the scene.

If an object of interest (for example, a human face) is identified in such a 3D map, the gating interval for the counters in the first mode described above can then be set, relative to the optical pulses emitted toward the object, based on the depth of the object of interest in the 3D map. The detector array will thus acquire a 2D or 3D image of the object of interest with enhanced rejection of background radiation on account of the short, targeted gating interval that is applied.

In this sort of gated 3D acquisition, the gating intervals can made shorter, within the range of interest, thus narrowing the histogram bins and enhancing the depth resolution of the apparatus. Yet another benefit of the range-gating capabilities of the apparatus is the elimination of interference due to multi-path reflections, which propagate over a longer range and thus will reach the detector after the gate has closed. (In the absence of range gating, both direct and multi-path reflections will be detected in the histogram.) When the range to the target scene is known, the intensity of the radiation source can also be controlled as a function of the range, to avoid saturation of the detectors at short range and compensate for weaker signals at long range.

Other embodiments provide novel methods for TOF measurement using an array of single-photon detectors. These methods may be implemented advantageously using the aggregation and gated counting capabilities of the apparatus described above; but the methods may alternatively be performed using other sorts of single-photon detector arrays and gated counting logic.

In one of these embodiments, a series of optical pulses is directed toward a target scene, and optical radiation that is reflected from the target scene is imaged onto an array of single-photon detectors. Logic circuits associated with the array (such as the array of counters described above) count the electrical pulses output by the single photon detectors in multiple different gating intervals that are synchronized with each of the optical pulses, with each gating interval at a different, respective delay relative to the optical pulses. The delays of the gating intervals relative to the optical pulses are swept over a sequence of different delay times during the series of the optical pulses, and each counter accumulates the electrical pulses from the respective gating interval over the sequence of different delays. A processor computes the times of flight of the optical pulses simply by comparing the respective counts of the electrical pulses that were accumulated in two of the gating intervals over the series of the optical pulses.

As will be explained further hereinbelow, this approach is able to achieve high resolution in time of flight using only a small number of different gating intervals, due to the modulation of the delays between the optical pulses and the gating intervals. In fact, only two such gating intervals are required, although additional gating intervals can advantageously be used in order to measure and subtract out background components of the optical radiation that is incident on the detector array, for example due to stray photons and ambient radiation, as well as to enhance the temporal resolution.

System Description

FIG. 1 is a schematic side view of depth mapping apparatus 20, in accordance with an embodiment of the invention. In the pictured embodiment, apparatus 20 is used to generate depth maps of an object 22, for example a part of the body of a user of the apparatus. To generate the depth map, an illumination assembly 24 directs pulses of light toward object 22, and an imaging assembly 26 captures the photons reflected from the object. (The term “light,” as used in the present description and in the claims, refers to optical radiation, which may be in any of the visible, infrared, and ultraviolet ranges; and pulses of light are equivalently referred to as “optical pulses.”)

Illumination assembly 24 typically comprises at least one pulsed laser 28, which emits short pulses of light, with pulse duration in the picosecond to nanosecond range and high repetition frequency, for example 100 MHz or more. Collection optics 30 direct the light toward object 22. Alternatively, other source configurations, pulse durations and repetition frequencies may be used, depending on application requirements. For example, illumination assembly may emit multiple pulsed beams of light along different, respective axes, so as to form a pattern of spots on object 22. In this case, although the spatial resolution of apparatus 20 in the transverse plane may be reduced, the depth resolution can be enhanced by concentrating the histogram capture and processing resources of imaging assembly 26 in the areas of the spots.

Imaging assembly 26 comprises objective optics 32, which image object 22 onto a sensing array 34, so that photons emitted by illumination assembly 24 and reflected from object 22 are incident on the sensing array. In the pictured embodiment, sensing array 34 comprises sensing circuits 36 and ancillary circuits 38. Sensing circuits 36 comprises an array of single-photon detectors 40, such as SPADs, each of which outputs electrical pulses indicative of a time of incidence of a single photon that is incident on the sensing element. Ancillary circuits 38 comprises an array of processing circuits 42, which are coupled respectively to the sensing elements.

Circuits 36 and 38 are disposed on a semiconductor substrate, which may comprise a single chip or two or more separate chips, which are then coupled together, for example using chip stacking techniques that are known in the art. Circuits 36 and 38 may be formed on one or more silicon wafers using well-known CMOS fabrication processes, based on SPAD sensor designs that are known in the art, along with accompanying counters and logic as described hereinbelow. Alternatively, the designs and principles of detection that are described herein may be implemented, mutatis mutandis, using other materials and processes. All such alternative implementations are considered to be within the scope of the present invention.

Imaging device 20 is timed to capture TOF information continually over a series of image frames, for example at a rate of thirty frames/sec. In each frame, processing circuits 42 count photons that are incident on detectors 40 in one or more gating intervals and store the respective counts in histogram bins corresponding to the gating intervals. A system controller 44 reads out the individual counter values, computes the times of flight of the optical pulses responsively to the counter values, and generates an output depth map, comprising the measured TOF—or equivalently, the measured depth value—at each pixel. The depth map is typically conveyed to a receiving device 46, such as a display or a computer or other processor, which segments and extracts high-level information from the depth map. Controller 44 may also set imaging device to capture two-dimensional images, as is described further hereinbelow.

System controller 44 typically comprises a programmable processor, such as a microprocessor or embedded microcontroller, which is programmed in software or firmware to carry out the functions that are described herein. This software or firmware may be stored in tangible, non-transitory computer-readable media, such as optical, magnetic, or electronic memory media.

Alternatively or additionally, at least some of the processing functions of controller 44 may be carried out by hard-wired or programmable digital logic circuits.

Structure and Operation of the Sensing Array

Reference is now made to FIGS. 2 and 3, which are block diagrams showing details of detectors 40 and processing circuits 42, in accordance with an embodiment of the invention. FIG. 2 shows a super-pixel 50, which comprises a group of detectors 40 that share certain processing circuits, as described below. Sensing array 34 typically comprises a matrix of many super-pixels of this sort. In the pictured example, super-pixel 50 comprises sixteen detectors 40, which are mutually adjacent in array 34; but alternatively, array 34 may be divided into super-pixels comprising larger or smaller numbers of detectors. FIG. 3 shows routing and aggregation logic, including a counter 58, that is included in each processing circuit 42.

As shown in FIG. 3, the electrical pulses output by each detector 40 are both input to a respective multiplexer and output via an aggregation line to the other processing circuits 42 in super-pixel 50. Multiplexer 54 receives control signals (not shown) from routing and aggregation logic 52 (FIG. 2), which control the aggregation mode of processing circuit 42. For example, the aggregation lines and multiplexers in super-pixel 50 may operate in a first aggregation mode in which each counter 58 (or at least some of the counters) aggregates and counts the electrical pulses output by a respective first group of detectors 40; and this first group may be limited to the single, respective detector 40 that is coupled directly to processing circuit 42. In a second aggregation mode, each counter 58 aggregates and counts the electrical pulses output by a second group of two or more of detectors 40, typically including at least four detectors, and possibly all of the detectors in super-pixel 50.

Routing and control logic 52 also receives and decodes gating instructions from system controller 44, and accordingly outputs a gating signal to an AND gate 56 in each processing circuit 42. The gating signal controls the periods, i.e., the gating intervals, during which each counter 58 aggregates and counts the electrical pulses that are output from detectors 40 via multiplexer 54. System controller 44 typically synchronizes the gating intervals with the optical pulses emitted by illumination assembly 24. In a particular embodiment that is described below, with reference to FIGS. 5-7, the gating intervals are synchronized with the optical pulses with a delay between the optical pulses and the gating intervals that is swept over a sequence of different delay times during a series of the optical pulses.

In some operating configurations, and particularly when operating in the second aggregation mode mentioned above, the gating signals cause different counters 58 in super-pixel 50 to aggregate and count the electrical pulses over different, respective gating intervals. As a result, the array of counters 58 will effectively output a histogram of the electrical pulses output by detectors 40 in super-pixel 50, with each bin of the histogram defined by a corresponding gating interval. Thus, in the present example, routing and control logic 52 may configure the histogram to have anywhere from two to sixteen bins. Alternatively, the gating signals may be set (particularly in the first aggregation mode) so that all of counters 58 share the same gating interval.

FIG. 4 is a block diagram that schematically illustrates an operating configuration of super-pixel 50 in the second aggregation mode, in accordance with an embodiment of the invention. In this case, routing and control logic 52 has configured super-pixel 50 to generate a four-bin histogram: The outputs of all of detectors 40 in super-pixel 50 (labeled collectively as “SPAD events”) are aggregated and input to AND gates 56, which are triggered by routing and control logic 52 to input the electrical pulses to respective counters 58 in different, respective gating intervals, at different respective delays relative to the optical pulses from illumination assembly 24. Counters 58 are interconnected by an overflow line 64, which stops all of the counters when one of them reaches saturation.

Based on the histogram generated by counters 58, system controller 44 computes the times of flight of the optical pulses that are emitted from illumination assembly and reflected back to each super-pixel 50. The system controller combines the TOF readings from the various super-pixels in array 34 in order to generate a 3D map of the target scene. In one embodiment, the system controller identifies an object of interest in the 3D map, for example object 22 (FIG. 1), and then sets the gating interval for counters 58 so that processing circuits 42 acquire a 2D image of the object of interest. In this 2D imaging mode, the gating interval and multiplexers 54 are set, based on the depth of the object of interest in the 3D map, so that each counter 42 will count only the electrical pulses output by the corresponding detector 40 during the interval in which optical pulses reflected from object 22 are expected to reach the detectors. Sensing array 34 will thus output a high-resolution 2D image of object 22, with low levels of background interference and noise.

In the embodiment shown in FIG. 4, another one of the AND gates, identified as gate 56′ (labeled “stray”), is triggered to input electrical pulses from detectors 40 to a counter 58′. The gating interval applied to gate 56′ is selected so that counter 58′ receives and counts electrical pulses that are indicative of a background component of the optical radiation that is incident on detectors 40. In computing the time of flight, system controller 44 uses the value of counter 58′ in compensating for the background component, and thus improving the accuracy of the histogram analysis.

For example, the gating interval applied to gate 56′ can be synchronized with the optical pulses emitted by illumination assembly 24 so that counter 58′ counts stray photons in the optical pulses that are incident on super-pixel 50 without having reflected from the target scene (in some cases due to photons with very short times of flight as a result of internal reflections within apparatus 20). Alternatively or additionally, the gating interval applied to gate 56′ may be chosen to occur at a time during which optical pulses from illumination assembly are not expected to reach sensing array 34, for example at a long delay after emission of the pulses. In this case, the electrical pulses counted by counter 58′ are indicative of the intensity of ambient optical radiation that is incident on super-pixel 50. Although only one background counter 58′ is shown in FIG. 4, two or more such counters may alternatively be allocated in order to count both stray and ambient optical intensities.

TOF Measurement Using Modulated Gating Delays

FIG. 5 is a timing diagram that schematically illustrates a method for measuring TOF to a target scene, in accordance with an embodiment of the invention. This method, as well as the methods illustrated in the figures that follow, will be described, for the sake of concreteness and clarity, with reference to the elements of apparatus 20, as described above and shown in the preceding figures. The principles of this embodiment, however, may similarly be applied using other sorts of sensing arrays with suitable gating and counting capabilities.

Specifically, FIG. 5 shows a series 70 of optical pulses 72 that are directed toward a target scene, such as object 22. The optical pulses are reflected from the target scene, giving rise to a corresponding series of reflected pulses, referred to as “echoes” 74, which are imaged onto super-pixels 50 in sensing array 34. When echoes 74 are incident on a given super-pixel 50, detectors 40 output corresponding electrical pulses with a delay, relative to the corresponding optical pulses 72, that is equal to the TOF of the optical pulses to and from the target scene.

Counters 58 are gated to count the electrical pulses output by the single photon detectors in multiple different gating intervals, which are synchronized with each of the optical pulses at different, respective delays relative to the optical pulses. The gating intervals are represented in FIG. 5 by corresponding bins 76 and 78, which hold the counts of the aggregated electrical pulses that are accumulated by the corresponding counters 58. Two additional bins 80 and 82 hold the counts of photons due to ambient and stray radiation, respectively, as explained above. Bin 82 receives echoes 84 occurring in close time proximity to each of optical pulses 72, substantially less than the expected TOF to the target scene.

The delays of bins 76 and 78 relative to optical pulses 72 are not fixed, but rather are swept over a sequence of different delay times during series 70 of the optical pulses. (In FIGS. 5-7, for clarity of illustration, the emission times of pulses 72 are shown as varying, while bins 76 and 78 are stationary, but the modulation of the delay times could equivalently be shown in terms of varying bin times relative to a stationary pulse time.) Bins 76 and 78 are synchronized at different, respective delays relative to optical pulses 72. The difference between the respective delays of bins 76 and 78 remains fixed, while both delays are swept over the sequence of different delay times during the series of the optical pulses.

In the specific scheme that is shown in FIG. 5, the durations of the gating intervals of bins 76 and 78 are both set to correspond to the maximum range of the target scene that is to be mapped by apparatus 20, with bin 78 beginning upon termination of bin 76. In other words, the temporal width of each bin 76, 78 is equal to the TOF of the optical pulses at the maximum range. Taking this maximum TOF to be T, the number of optical pulses 72 in series 70 to be N, and the additional dead time between successive optical pulses 72 to be D (due, inter alia, to the time needed by detectors 40 to recover after having output an electrical pulse), the pulse repetition interval (PRI) of the optical pulses is set to be PRI=2T+D+T/N+S. (The parameter S≥0 is chosen to account for dead time variation, control the average power of the pulsed illumination, and prevent range folding. Furthermore, S may be varied among successive series of pulses in order to mitigate the effects of electromagnetic and optical interference on other devices in the vicinity of apparatus 20.)

Thus, as shown in FIG. 5, series 70 spans the duration of bin 76 (which is equal to the duration of bin 78, as noted above). As a result of these choices of the durations of series 70 and bins 76 and 78, the photons in optical pulses 72 that are reflected from the target scene are incident on detectors 40 only during the gating intervals of bins 76 and 78

System controller 44 computes the TOF for super-pixel 50 by comparing the respective counts of the electrical pulses in bins 76 and 78 over series 70 of optical pulses 72. Specifically, in the present case, the system controller subtracts the ambient count in bin 80 from the counts in both of bins 76 and 78, and also subtracts the stray count in bin 82 from the count in bin 76, thus canceling out the background effects of ambient light and stray reflections. After subtracting these background components, system controller 44 computes the ratio R of the remainder of the count in bin 78 to the remainder of the count in bin 76. The TOF is proportional to the ratio, i.e., TOF=R*T. This approach enables system controller 44 to find depth coordinates with high resolution, even using only two bins for count accumulation.

FIG. 6 is a timing diagram that schematically illustrates a method for measuring TOF to a target scene, in accordance with another embodiment of the invention. The principles of this method are similar to those of FIG. 5, except that in this case, the gating intervals of counters 58 in super-pixel 50 are set so as to define a larger number of successive bins 90 in which the electrical pulses from detectors 40 are aggregated, in order to enhance the resolution of the TOF measurement.

In the embodiment of FIG. 6, echoes 74 may be distributed over M+1 bins, wherein in the present example M=4 (in addition to background bins 80 and 82). The duration of the gating interval of each bin 90 is T/M. The PRI of optical pulses 72 in this case is set to the value

${PRI} = {{\frac{M + 1}{M}T} + \frac{T}{MN} + D + {S.}}$

In the pictured example, the range of the target scene is such that echoes 74 are divided between bin 3 and bin 4, and the ratio of the counts in these bins (after subtraction of the ambient background) gives the TOF relative to the start time of bin 3.

FIG. 7 is a timing diagram that schematically illustrates a method for measuring TOF to a target scene, in accordance with yet another embodiment of the invention. This embodiment is similar to the embodiment of FIG. 6, except that in this case the counts of electrical pulses are aggregated in successive bins 92 with respective gating intervals that partially overlap one another. In other words, the initial part of each gating interval overlaps with the final part of the preceding gating interval.

The overlap in this embodiment reflects the fact that optical pulses 72 have a finite width. The overlap between the gating intervals of successive bins is typically on the order of the pulse width. In this case, the simple ratio formula presented above is not strictly accurate. The precise relation between the numbers of counts in the bins and the corresponding time of flight can be estimated, for example, using a maximum likelihood analysis or a suitably trained neural network. System controller 44 compares the counts in the various bins 92 using this relation, and thus computes the TOF for each super-pixel 50.

It will be appreciated that the embodiments described above are cited by way of example, and that the present invention is not limited to what has been particularly shown and described hereinabove. Rather, the scope of the present invention includes both combinations and subcombinations of the various features described hereinabove, as well as variations and modifications thereof which would occur to persons skilled in the art upon reading the foregoing description and which are not disclosed in the prior art. 

1. Optical sensing apparatus, comprising: at least one semiconductor substrate; a first array of single-photon detectors, which are disposed on the at least one semiconductor substrate and are configured to output electrical pulses in response to photons that are incident thereon; a second array of counters, which are disposed on the at least one semiconductor substrate and are configured to count the electrical pulses output by the single-photon detectors; and routing and aggregation logic, which is configured, in response to a control signal, to connect the single-photon detectors to the counters in a first mode in which each of at least some of the counters aggregates and counts the electrical pulses output by a respective first group of one or more of the single-photon detectors, and in a second mode in which each of the at least some of the counters aggregates and counts the electrical pulses output by a respective second group of two or more of the single-photon detectors.
 2. The apparatus according to claim 1, wherein the single-photon detectors comprises single-photon avalanche diodes (SPADs).
 3. The apparatus according to claim 1, wherein the control signal comprises a gating signal, and wherein the counters are configured to aggregate and count the electrical pulses over respective periods indicated by the gating signal.
 4. The apparatus according to claim 3, wherein the gating signal causes different ones of the counters to aggregate and count the electrical pulses over different, respective gating intervals, so that the second array of counters outputs a histogram of the electrical pulses output by the single-photon detectors with bins defined responsively to the gating intervals.
 5. The apparatus according to claim 4, and comprising a radiation source, which is configured to direct a series of optical pulses toward a target scene, and the single-photon detectors are configured to receive optical radiation that is reflected from the target scene, and wherein the counters are configured to aggregate and count the electrical pulses while the gating intervals are synchronized with the optical pulses with a delay between the optical pulses and the gating intervals that is swept over a sequence of different delay times during the series of the optical pulses.
 6. The apparatus according to claim 5, wherein the counters are configured to aggregate and count the electrical pulses in first and second bins of the histogram while the gating intervals are swept over the sequence of different delay times, and the apparatus comprises a processor, which is configured to compute a time of flight of the optical pulses by comparing respective first and second counts accumulated in the first and second bins.
 7. The apparatus according to claim 1, wherein in the first mode, each of the counters counts the electrical pulses that are output by a single, respective one of single-photon detectors.
 8. The apparatus according to claim 7, wherein in the second mode, each of the at least some of the counters aggregates and counts the electrical pulses output by at least four of the single-photon detectors that are mutually adjacent in the first array.
 9. The apparatus according to claim 8, wherein the control signal comprises a gating signal, which causes the counters to aggregate and count the electrical pulses over respective gating intervals, and wherein the apparatus comprises: a radiation source, which is configured to direct a series of optical pulses toward a target scene, wherein the single-photon detectors are configured to receive optical radiation that is reflected from the target scene; and a processor, which is configured to compute a time of flight of the optical pulses responsively to counts of the electrical pulses that are output by the counters over different gating intervals while operating in the second mode, and to apply the computed time of flight in setting a gating interval for the counters in the first mode.
 10. The apparatus according to claim 9, wherein the processor is configured to generate a three-dimensional (3D) map of the target scene responsively to the time of flight computed in the second mode, to identify an object of interest in the 3D map, and to set the gating interval for the counters in the first mode responsively to a depth of the object of interest in the 3D map so as to acquire a two-dimensional (2D) image of the object of interest.
 11. A method for optical sensing, comprising: providing, on at least one semiconductor substrate, a first array of single-photon detectors, which are configured to output electrical pulses in response to photons that are incident on the single-photon detectors; providing, on the at least one semiconductor substrate, a second array of counters, which are configured to count the electrical pulses output by the single-photon detectors; and in response to a control signal, connecting the single-photon detectors to the counters in a first mode in which each of at least some of the counters aggregates and counts the electrical pulses output by a respective first group of one or more of the single-photon detectors, and in a second mode in which each of the at least some of the counters aggregates and counts the electrical pulses output by a respective second group of two or more of the single-photon detectors.
 12. The method according to claim 11, wherein the control signal comprises a gating signal, which causes the counters to aggregate and count the electrical pulses over respective periods indicated by the gating signal.
 13. The method according to claim 12, wherein the gating signal causes different ones of the counters to aggregate and count the electrical pulses over different, respective gating intervals, so that the second array of counters outputs a histogram of the electrical pulses output by the single-photon detectors with bins defined responsively to the gating intervals.
 14. The method according to claim 13, and comprising directing a series of optical pulses toward a target scene, and receiving at the single-photon detectors optical radiation that is reflected from the target scene, and wherein the counters are configured to aggregate and count the electrical pulses while the gating intervals are synchronized with the optical pulses with a delay between the optical pulses and the gating intervals that is swept over a sequence of different delay times during the series of the optical pulses.
 15. The method according to claim 14, wherein the counters are configured to aggregate and count the electrical pulses in first and second bins of the histogram while the gating intervals are swept over the sequence of different delay times, and the method comprises computing a time of flight of the optical pulses by comparing respective first and second counts accumulated in the first and second bins.
 16. The method according to claim 11, wherein in the first mode, each of the counters counts the electrical pulses that are output by a single, respective one of single-photon detectors.
 17. The method according to claim 16, wherein in the second mode, each of the at least some of the counters aggregates and counts the electrical pulses output by at least four of the single-photon detectors that are mutually adjacent in the first array.
 18. The method according to claim 17, wherein the control signal comprises a gating signal, which causes the counters to aggregate and count the electrical pulses over respective gating intervals, and wherein the method comprises: directing a series of optical pulses toward a target scene, wherein the single-photon detectors receive optical radiation that is reflected from the target scene; computing a time of flight of the optical pulses responsively to counts of the electrical pulses that are output by the counters over different gating intervals while operating in the second mode; and applying the computed time of flight in setting a gating interval for the counters in the first mode.
 19. The method according to claim 18, and comprising computing a three-dimensional (3D) map of the target scene responsively to the time of flight computed in the second mode, identifying an object of interest in the 3D map, and setting the gating interval for the counters in the first mode responsively to a depth of the object of interest in the 3D map so as to acquire a two-dimensional (2D) image of the object of interest.
 20. A method for optical sensing, comprising: directing a series of optical pulses toward a target scene; imaging optical radiation that is reflected from the target scene onto an array of single-photon detectors, which output electrical pulses in response to photons that are incident thereon; counting the electrical pulses output by the single photon detectors in multiple different gating intervals that are synchronized with each of the optical pulses, including at least first and second gating intervals at different, respective delays relative to the optical pulses, while the delays are swept over a sequence of different delay times during the series of the optical pulses; and computing a time of flight of the optical pulses by comparing respective first and second counts of the electrical pulses that were accumulated in the first and second gating intervals over the series of the optical pulses. 